package tieba.entity;

// Generated 2014-11-22 2:15:43 by Hibernate Tools 4.0.0

import static javax.persistence.GenerationType.IDENTITY;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
 * TbUser generated by hbm2java
 */
@Entity
@Table(name = "tb_user", catalog = "tb")
@JsonIgnoreProperties(ignoreUnknown = true)
public class TbUser implements java.io.Serializable {

	@JsonIgnore
	private Integer buId;
	@JsonIgnore
	private CmsUser cmsUser;
	@JsonIgnore
	private String email;
	private String username;
	private String password;
	@JsonIgnore
	private String headUrl;
	@JsonIgnore
	private String BAIDUID;
	private String bduss;
	private String codestring;
	private String verifycode;
	private Map<String, String> cookies = new HashMap<>();
	@JsonIgnore
	private Set<TbSignTask> tbSignTasks = new HashSet<TbSignTask>(0);

	@Transient
	public Map<String, String> getCookies() {
		return cookies;
	}

	public void setCookies(Map<String, String> cookies) {
		this.cookies = cookies;
	}

	@Transient
	@JsonIgnore
	public String getBAIDUID() {
		return BAIDUID;
	}

	public void setBAIDUID(String bAIDUID) {
		BAIDUID = bAIDUID;
	}

	public TbUser() {
	}

	public TbUser(CmsUser cmsUser, String email, String username,
			String password, String headUrl, String bduss, String codestring,
			String verifycode, Set<TbSignTask> tbSignTasks) {
		this.cmsUser = cmsUser;
		this.email = email;
		this.username = username;
		this.password = password;
		this.headUrl = headUrl;
		this.bduss = bduss;
		this.codestring = codestring;
		this.verifycode = verifycode;
		this.tbSignTasks = tbSignTasks;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "bu_id", unique = true, nullable = false)
	public Integer getBuId() {
		return this.buId;
	}

	public void setBuId(Integer buId) {
		this.buId = buId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "cu_id")
	public CmsUser getCmsUser() {
		return this.cmsUser;
	}

	public void setCmsUser(CmsUser cmsUser) {
		this.cmsUser = cmsUser;
	}

	@Column(name = "email")
	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(name = "username")
	public String getUsername() {
		return this.username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	@Column(name = "password")
	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Column(name = "head_url")
	public String getHeadUrl() {
		return this.headUrl;
	}

	public void setHeadUrl(String headUrl) {
		this.headUrl = headUrl;
	}

	@Column(name = "bduss")
	public String getBduss() {
		return this.bduss;
	}

	public void setBduss(String bduss) {
		this.bduss = bduss;
	}

	@Transient
	public String getCodestring() {
		return this.codestring;
	}

	public void setCodestring(String codestring) {
		this.codestring = codestring;
	}

	@Transient
	public String getVerifycode() {
		return this.verifycode;
	}

	public void setVerifycode(String verifycode) {
		this.verifycode = verifycode;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "tbUser")
	public Set<TbSignTask> getTbSignTasks() {
		return this.tbSignTasks;
	}

	public void setTbSignTasks(Set<TbSignTask> tbSignTasks) {
		this.tbSignTasks = tbSignTasks;
	}

}
